﻿var _is = false;
var bz = 2015;
var fz = 2000;
var dlg = {
    element: function () {
        if (_is) {
            fz = bz + 1;
            bz += 2
        }
        _is = true;
        this._title = "标题";
        this._content = "内容";
        this._fn1 = function () { };
        this._fn2 = function () { };
        this._width = 350;
        this._height = 200;
        this._mask = $('<div style="position:fixed; _position:absolute; display:none; top:0px; left:0px; _top:expression(eval(document.documentElement.scrollTop)); _left:expression(eval(document.documentElement.scrollLeft)); background:#000; z-index:' + fz + '; filter:alpha(opacity=20); opacity:0.2; width:100%;" id="mask"><iframe scrolling="no" style="filter:alpha(opacity=0); opacity:0; width:100%; height:100%; display:none; *display:block; " ></iframe></div>');
        this._obj = $('<div class="box_dialog" style="z-index:' + bz + '"></div>');
        this._head = $('<h1 class="dialog_title"></h1>');
        this._cont = $('<div class="dialog_content"></div>');
        this._ifra = $('<iframe class="dialog_iframe" scrolling="no"  frameborder="0"  src=""></iframe>');
        this._text = $('<span class="dialog_txt"></span>');
        this._foot = $('<div class="dialog_bottom"></div>');
        this._info = $('<i class="ico_info"></i>');
        this._aler = $('<i class="ico_aler"></i>');
        this._ques = $('<i class="ico_ques"></i>');
        this._erro = $('<i class="ico_erro"></i>');
        this._corr = $('<i class="ico_corr"></i>')
    },
    Msg: {
        elem: function () {
            this._fn = function () { };
            this._mask = $('<div style="position:fixed; _position:absolute; display:none; top:0px; left:0px; _top:expression(eval(document.documentElement.scrollTop)); _left:expression(eval(document.documentElement.scrollLeft)); z-index:999; width:100%; filter:alpha(opacity=0); opacity:0; background:#fff;" id="mask0"><iframe scrolling="no" style="filter:alpha(opacity=0); opacity:0; width:100%; height:100%; display:none; *display:block;" ></iframe></div>');
            this._obj = $('<div class="box_sugg" style="z-index:' + bz + '"></div>');
            this._left = $('<b class="sugg_left"></b>');
            this._right = $('<b class="sugg_right"></b>');
            this._con = $('<div class="sugg_con"></div>');
            this._incon = $('<span class="sugg_in_con"></span>');
            this._info = $('<i class="ico_info"></i>');
            this._erro = $('<i class="ico_erro"></i>');
            this._corr = $('<i class="ico_corr"></i>');
            this._load = $('<i class="ico_load"></i>')
        },
        ply: function (a, d, h) {
            var b = new this.elem();
            $.extend(b, {
                _fn: d
            });
            var i = b._obj;
            var g = b._mask;
            i.append(b._left);
            switch (h) {
                case 1:
                    i.append(b._info);
                    break;
                case 2:
                    i.append(b._erro);
                    break;
                case 3:
                    i.append(b._corr);
                    break;
                case 4:
                    i.append(b._load);
                    break
            }
            i.append(b._con);
            i.append(b._right);
            b._con.append(b._incon);
            b._incon.append(a);
            $("body").append(g);
            $("body").append(i);
            if ($.browser.msie && $.browser.version == 6) {
                var j = $(document).scrollTop() + ($(window).height() - i.height()) / 3
            } else {
                var j = ($(window).height() - i.height()) / 3
            }
            var f = ($(window).width() - i.width()) / 2;
            var a = function () {
                var e = $(document).scrollTop() + ($(window).height() - i.height()) / 3;
                var c = ($(window).width() - i.width()) / 2;
                i.css({
                    top: e,
                    left: c
                });
                g.css({
                    top: e,
                    left: c
                })
            };
            if ($.browser.msie && $.browser.version <= 6) {
                $(window).bind("scroll", function () {
                    a()
                })
            }
            if ($.browser.msie && $.browser.version < 9) {
                if (h == 4) {
                    i.attr("id", d);
                    g.attr("id", d + "mask0");
                    i.css({
                        top: j,
                        left: f
                    }).show()
                } else {
                    i.css({
                        top: j,
                        left: f
                    }).show();
                    setTimeout(function () {
                        if ($.browser.msie && $.browser.version == 6) {
                            var c = $("<input type='text'/>");
                            i.append(c);
                            c.focus();
                            c.remove()
                        }
                        i.remove();
                        g.remove();
                        b._fn()
                    }, 2000)
                }
            } else {
                if (h == 4) {
                    i.attr("id", d);
                    g.attr("id", d + "mask0");
                    i.css({
                        top: j,
                        left: f
                    }).show()
                } else {
                    i.css({
                        top: j,
                        left: f,
                        opacity: "0"
                    }).show();
                    i.animate({
                        opacity: "1"
                    }, 400, function () {
                        setTimeout(function () {
                            i.animate({
                                opacity: "0"
                            }, 400, function () {
                                i.remove();
                                g.remove();
                                b._fn()
                            })
                        }, 2000)
                    })
                }
            }
            g.css({
                height: $(i).height(),
                width: $(i).width(),
                top: $(i).offset().top,
                left: $(i).offset().left
            }).show()
        },
        Inf: function (a, b) {
            this.ply(a, b, 1)
        },
        Err: function (a, b) {
            this.ply(a, b, 2)
        },
        Cor: function (a, b) {
            this.ply(a, b, 3)
        },
        Lod: function (a, b) {
            if (document.getElementById(b)) { } else {
                this.ply(a, b, 4)
            }
        }
    },
    Alert: function (i, d, g, h) {
        var f = new this.element();
        $.extend(f, {
            _title: i,
            _content: d,
            _fn1: g,
            _fn2: h
        });
        var a = this.btn(f._obj, f._mask, "close", "关闭", f._fn2, true);
        var b = this.btn(f._obj, f._mask, " ui blue button", "确定", f._fn1, true, '<i class="checkmark icon"></i>');
        f._obj.append(f._head);
        f._obj.append(f._cont);
        f._obj.append(f._foot);
        f._obj.append(a);
        f._cont.append(f._aler);
        f._cont.append(f._text);
        f._foot.append(b);
        f._head.html(f._title);
        f._text.html(f._content);
        this.opn(f._obj, f._mask);
        this.drag(f._obj, f._head)
    },
    Confirm: function (j, f, h, i) {
        var g = new this.element();
        $.extend(g, {
            _title: j,
            _content: f,
            _fn1: h,
            _fn2: i
        });
        var a = this.btn(g._obj, g._mask, "close", "关闭", g._fn2, true);
        var b = this.btn(g._obj, g._mask, " ui blue button", "确定", g._fn1, true, '<i class="checkmark icon"></i>');
        var d = this.btn(g._obj, g._mask, " ui button", "取消", g._fn2, true, '<i class="remove icon"></i>');
        g._obj.append(g._head);
        g._obj.append(g._cont);
        g._obj.append(g._foot);
        g._obj.append(a);
        g._cont.append(g._ques);
        g._cont.append(g._text);
        g._foot.append(b);
        g._foot.append(d);
        g._head.html(g._title);
        g._text.html(g._content);
        this.opn(g._obj, g._mask);
        this.drag(g._obj, g._head)
    },
    Infor: function (f, h) {
        var g = new this.element();
        $.extend(g, {
            _title: "消息",
            _content: f,
            _fn1: h
        });
        var a = this.btn(g._obj, g._mask, "close", "关闭", g._fn2, true);
        var b = this.btn(g._obj, g._mask, " ui blue button", "确定", g._fn1, true, '<i class="checkmark icon"></i>');
        var d = this.btn(g._obj, g._mask, " ui button", "取消", g._fn2, true, '<i class="remove icon"></i>');
        g._obj.append(g._head);
        g._obj.append(g._cont);
        g._obj.append(g._foot);
        g._obj.append(a);
        g._cont.append(g._info);
        g._cont.append(g._text);
        g._foot.append(b);
        g._foot.append(d);
        g._head.html(g._title);
        g._text.html(g._content);
        this.opn(g._obj, g._mask);
        this.drag(g._obj, g._head)
    },
    Error: function (f, h) {
        var g = new this.element();
        $.extend(g, {
            _title: "错误",
            _content: f,
            _fn1: h
        });
        var a = this.btn(g._obj, g._mask, "close", "关闭", g._fn2, true);
        var b = this.btn(g._obj, g._mask, " ui blue button", "确定", g._fn1, true, '<i class="checkmark icon"></i>');
        var d = this.btn(g._obj, g._mask, " ui button", "取消", g._fn2, true, '<i class="remove icon"></i>');
        g._obj.append(g._head);
        g._obj.append(g._cont);
        g._obj.append(g._foot);
        g._obj.append(a);
        g._cont.append(g._erro);
        g._cont.append(g._text);
        g._foot.append(b);
        g._foot.append(d);
        g._head.html(g._title);
        g._text.html(g._content);
        this.opn(g._obj, g._mask);
        this.drag(g._obj, g._head)
    },
    Common: function (j, f, k, h, i) {
        var g = new this.element();
        $.extend(g, {
            _title: j,
            _content: f,
            _width: k,
            _fn1: h,
            _fn2: i
        });
        var a = this.btn(g._obj, g._mask, "close", "关闭", g._fn2, true);
        var b = this.btn(g._obj, g._mask, " ui button", "确定", g._fn1, true);
        var d = this.btn(g._obj, g._mask, " ui button", "取消", g._fn2, true);
        g._obj.append(g._head);
        g._obj.append(g._cont);
        g._obj.append(g._foot);
        g._obj.append(a);
        g._foot.append(b);
        g._foot.append(d);
        g._head.html(g._title);
        g._cont.html(g._content);
        g._obj.css("width", g._width);
        this.opn(g._obj, g._mask);
        this.drag(g._obj, g._head)
    },
    Com: function (g, h, b, i, f) {
        var d = new this.element();
        $.extend(d, {
            _title: h,
            _content: '<div class="dialog_center">' + b + '</div>',
            _width: i,
            _fn1: f
        });
        var a = this.btn(d._obj, d._mask, "close", "关闭", d._fn1, false);
        d._obj.append(d._head);
        d._obj.append(d._cont);
        d._obj.append(a);
        d._head.html(d._title);
        d._cont.html(d._content);
        d._obj.css("width", d._width);
        d._obj.css("overflow-y", "auto");
        d._obj.children().next().css("overflow-y", "auto");
        d._obj.children().next().css("max-height", 400);
        d._obj.attr("id", g);
        d._mask.attr("id", g + "Mask");
        this.opn(d._obj, d._mask);
        this.drag(d._obj, d._head)
    },
    fix: false,
    outScroll: false,
    Url: function (i, k, b, l, g, f, j) {
        var d = new this.element();
        $.extend(d, {
            _title: k,
            _content: b,
            _width: l,
            _height: g,
            _fn1: f
        });
        var a = this.btn(d._obj, d._mask, "close", "关闭", d._fn1, false);
        d._obj.append(d._head);
        d._obj.append(d._ifra);
        d._obj.append(a);
        d._head.html(d._title);
        d._ifra.attr({
            src: d._content,
            width: l,
            height: g
        });
        if (j) {
            d._ifra.attr({
                scrolling: "auto"
            })
        }
        d._obj.css("width", d._width);
        d._obj.attr("id", i);
        d._mask.attr("id", i + "Mask");
        this.opn(d._obj, d._mask);
        this.drag(d._obj, d._head)
    },
    Iframe: function (k, m, d, o, j, g, a) {
        var f = new this.element();
        $.extend(f, {
            _title: m,
            _content: d,
            _width: o,
            _height: j,
            _fn1: g
        });
        var b = this.btn(f._obj, f._mask, "close", "关闭", f._fn1, false);
        f._obj.append(f._head);
        f._obj.append(f._ifra);
        f._obj.append(b);
        f._head.html(f._title);
        f._obj.css({
            width: f._width
        });
        f._obj.attr("id", k);
        f._mask.attr("id", k + "Mask");
        var i = function () {
            var c = document.getElementById(k).getElementsByTagName("*");
            var h = null;
            for (var e = 0, p = c.length; e < p; e++) {
                if (c[e].className == "dialog_iframe") {
                    h = c[e];
                    break
                }
            }
            return h
        };
        if (a) {
            f._ifra.attr({
                src: f._content,
                width: o,
                height: j
            });
            this.opn(f._obj, f._mask);
            this.drag(f._obj, f._head);
            var l = i();
            if ($.browser.msie && $.browser.version <= 6) {
                setTimeout(function (c) {
                    return function () {
                        var e = c.getAttribute("src");
                        c.setAttribute("src", e)
                    }
                }(l), 100)
            }
            var n = setInterval(function (c) {
                return function () {
                    var e = j;
                    if (c) {
                        try {
                            if (c.contentWindow) {
                                e = c.contentWindow.document.body.offsetHeight
                            } else {
                                e = c.contentDocument.body.offsetHeight
                            }
                        } catch (h) { }
                        if (e != j) {
                            c.setAttribute("height", e);
                            j = e
                        }
                    } else {
                        clearInterval(n)
                    }
                }
            }(l), 500)
        } else {
            f._ifra.attr({
                src: f._content,
                width: o,
                height: j,
                scrolling: "auto"
            });
            dlg.fix = true;
            dlg.outScroll = true;
            this.opn(f._obj, f._mask);
            this.drag(f._obj, f._head);
            var l = i();
            if ($.browser.msie && $.browser.version <= 6) {
                setTimeout(function (c) {
                    return function () {
                        var e = c.getAttribute("src");
                        c.setAttribute("src", e)
                    }
                }(l), 100)
            }
        }
    },
    btn: function (f, e, a, h, b, c, d) {
        return $("<button href='javascript:;'></button>").attr({
            "class": a,
            title: h
        }).html(d).append(h).on("click", function () {
            b();
            if (c == true) {
                dlg._cls(f, e)
            }
        })
    },
    opn: function (h, g) {
        if (dlg.outScroll == true) {
            $("html,body").css("overflow", "hidden")
        }
        $("body").append(g);
        $("body").append(h);
        g.height($(window).height());
        if (dlg.fix) {
            if ($.browser.msie && $.browser.version <= 6) {
                var j = $(document).scrollTop() + ($(window).height() - h.height()) / 3;
                var k = ($(window).height() - h.height()) / 3
            } else {
                var j = ($(window).height() - h.height()) / 3
            }
            if (j < 0) {
                j = 0
            }
            var f = ($(window).width() - h.width()) / 2;
            if (this.animation() == 0) {
                var i = h.attr("style") + "; position:fixed; left:" + f + "px; top:" + j + "px; _position:absolute; _top:expression(eval(document.documentElement.scrollTop +" + k + "))";
                h.attr("style", i);
                h.attr("style", i);
                g.show();
                h.show()
            }
            if (this.animation() == 1) {
                h.css({
                    top: j - 50 + "px",
                    left: f + "px",
                    opacity: "0",
                    position: "fixed"
                }).show();
                g.fadeIn(200, function () {
                    h.animate({
                        top: j,
                        opacity: "1"
                    }, 300)
                })
            }
            if (this.animation() == 2) {
                var c = $(document).scrollTop() + $(window).height() / 3;
                var b = $(window).width() / 2;
                var d = h.width();
                var a = h.height();
                var e = $('<div style="background:#fff; position:fixed; z-index:1001; filter:alpha(opacity=80); opacity:0.8; "></div>');
                e.css({
                    width: "0px",
                    height: "0px",
                    top: c,
                    left: b
                });
                $("body").append(e);
                g.fadeIn(200, function () {
                    e.animate({
                        width: d,
                        height: a,
                        top: j,
                        left: f
                    }, 300, function () {
                        e.remove();
                        h.css({
                            top: j,
                            left: f,
                            position: "fixed"
                        }).show()
                    })
                })
            }
            $(window).bind("resize", function () {
                var l = ($(window).width() - h.width()) / 2;
                if ($.browser.msie && $.browser.version <= 6) {
                    h.css("left", l);
                    var n = ($(window).height() - h.height()) / 3;
                    var m = h.attr("style") + "; top:expression(eval(document.documentElement.scrollTop +" + n + "))";
                    h.attr("style", m)
                } else {
                    var n = ($(window).height() - h.height()) / 3;
                    if (n <= 0) {
                        n = 0
                    }
                    h.css({
                        top: n + "px",
                        left: l + "px"
                    })
                }
                g.height($(window).height());
                if ($(window).width() < 986) {
                    g.width("986px")
                } else {
                    g.width("100%")
                }
            })
        } else {
            var j = $(document).scrollTop() + ($(window).height() - h.height()) / 3;
            if (j < 0) {
                j = 0
            }
            var f = ($(window).width() - h.width()) / 2;
            if (this.animation() == 0) {
                h.css({
                    top: j + "px",
                    left: f + "px"
                });
                g.show();
                h.show()
            }
            if (this.animation() == 1) {
                h.css({
                    top: j - 50 + "px",
                    left: f + "px",
                    opacity: "0"
                }).show();
                g.fadeIn(200, function () {
                    h.animate({
                        top: j,
                        opacity: "1"
                    }, 300)
                })
            }
            if (this.animation() == 2) {
                var c = $(document).scrollTop() + $(window).height() / 3;
                var b = $(window).width() / 2;
                var d = h.width();
                var a = h.height();
                var e = $('<div style="background:#fff; position:absolute; z-index:1001; filter:alpha(opacity=80); opacity:0.8; "></div>');
                e.css({
                    width: "0px",
                    height: "0px",
                    top: c,
                    left: b
                });
                $("body").append(e);
                g.fadeIn(200, function () {
                    e.animate({
                        width: d,
                        height: a,
                        top: j,
                        left: f
                    }, 300, function () {
                        e.remove();
                        h.css({
                            top: j,
                            left: f
                        }).show()
                    })
                })
            }
            $(window).bind("resize", function () {
                var m = $(document).scrollTop() + ($(window).height() - h.height()) / 3;
                if (m < 0) {
                    m = 0
                }
                var l = ($(window).width() - h.width()) / 2;
                h.css({
                    top: m + "px",
                    left: l + "px"
                });
                g.height($(window).height());
                if ($(window).width() < 986) {
                    g.width("986px")
                } else {
                    g.width("100%")
                }
            })
        }
    },
    _cls: function (k, j) {
        var d = function (l) {
            var m = null;
            m = l;
            if (m) {
                try {
                    if ($.browser.msie) {
                        dc = m.contentWindow.document
                    } else {
                        dc = m.contentDocument
                    }
                    if (dc) {
                        dc.write("");
                        dc.clear();
                        dc.close()
                    }
                } catch (i) { }
                m.setAttribute("src", "javascript:false");
                m.parentNode.removeChild(m);
                m = null
            }
            if ($.browser.msie) {
                CollectGarbage();
                setTimeout(function () {
                    CollectGarbage()
                }, 1)
            }
        };
        if (dlg.outScroll == true) {
            $("html,body").css("overflow", "")
        }
        var e = $(k).find("iframe");
        for (var f = 0, g = e.length; f < g; f++) {
            if (e[f].tagName == "IFRAME") {
                d(e[f])
            }
        }
        if ($.browser.msie && $.browser.version <= 6) {
            var n = $("<input type='text'/>");
            k.append(n);
            n.focus();
            n.remove()
        }
        if (this.animation() == 0) {
            k.css("top", "");
            j.remove();
            k.remove()
        }
        if (this.animation() == 1) {
            var h = k.position().top + 50;
            k.animate({
                top: h,
                opacity: "0"
            }, 300, function () {
                k.hide();
                j.fadeOut(200, function () {
                    j.remove();
                    k.remove()
                })
            })
        }
        if (this.animation() == 2) {
            var b = $(document).scrollTop() + $(window).height() / 3;
            var a = $(window).width() / 2;
            var c = $('<div style="background:#fff; position:absolute; z-index:1001; filter:alpha(opacity=80); opacity:0.8;"></div>');
            c.css({
                width: k.width(),
                height: k.height(),
                top: k.css("top"),
                left: k.css("left")
            });
            $("body").append(c);
            k.hide();
            c.animate({
                width: "0",
                height: "0",
                top: b,
                left: a
            }, 300, function () {
                c.remove();
                j.fadeOut(200, function () {
                    j.remove();
                    k.remove()
                })
            })
        }
        $(window).unbind("resize");
        dlg.fix = false;
        dlg.outScroll = false
    },
    cls: function (a) {
        var c = $("#" + a);
        var b = $("#" + a + "Mask");
        this._cls(c, b)
    },
    clsLod: function (a) {
        var c = $("#" + a);
        var b = $("#" + a + "mask0");
        c.remove();
        b.remove()
    },
    clo: function (a) {
        window.parent.dlg.cls(a)
    },
    center: function (a) {
        if (document.getElementById(a)) {
            var c = $("#" + a);
            var d = $(document).scrollTop() + ($(window).height() - c.height()) / 3;
            if (d < 0) {
                d = 0
            }
            var b = ($(window).width() - c.width()) / 2;
            c.css({
                top: d + "px",
                left: b + "px"
            })
        }
    },
    animation: function () {
        if ($.browser.msie && $.browser.version == 6) {
            return 0
        } else {
            return 2
        }
    },
    option: function (a) {
        for (var b = 0, c = a.length; b < c; b++) {
            if (typeof (a[b]) == "object") {
                return a[b]
            }
        }
        return false
    },
    drag: function (f, h) {
        var c, d;
        var g = $(f);
        var b = $(h);
        if (dlg.fix) {
            var i = $('<div class="box_dashed" style="position:fixed; _position:absolute;"><div class="in_dashed"></div></div>')
        } else {
            var i = $('<div class="box_dashed"><div class="in_dashed"></div></div>')
        }
        b.on("mousedown", function (j) {
            i.css({
                left: $(g).css("left"),
                top: $(g).css("top"),
                width: $(g).css("width"),
                height: $(g).css("height")
            });
            $("body").append(i);
            j = j || window.event;
            c = j.clientX - g.offset().left;
            d = j.clientY - g.offset().top;
            if (document.body.setCapture) {
                document.body.onmousemove = e;
                document.body.onmouseup = a;
                document.body.setCapture()
            } else {
                document.addEventListener("mousemove", e, false);
                document.addEventListener("mouseup", a, false)
            }
        });
        var e = function (k) {
            k = k || window.event;
            var m = k.clientX - c;
            var n = k.clientY - d;
            if (dlg.fix) {
                m = k.clientX - c - $(document).scrollLeft();
                n = k.clientY - d - $(document).scrollTop();
                if ($.browser.msie && $.browser.version <= 6) {
                    m = k.clientX - c;
                    n = k.clientY - d
                }
            }
            var l = $(document).width() - g.outerWidth(true);
            var j = $(document).height() - g.outerHeight(true);
            if (m < 0) {
                m = 0
            } else {
                if (m > l) {
                    m = l
                }
            }
            if (n < 0) {
                n = 0
            } else {
                if (n > j) {
                    n = j
                }
            }
            i.css({
                left: m + "px",
                top: n + "px"
            });
            window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty()
        };
        var a = function () {
            i.remove();
            g.css({
                left: i.css("left"),
                top: i.css("top")
            });
            if (dlg.fix) {
                if ($.browser.msie && $.browser.version <= 6) {
                    h = parseInt(i.css("top")) - $(document).scrollTop();
                    if (h <= 0) {
                        h = 0;
                        g.css("top", $(document).scrollTop())
                    }
                    var j = g.attr("style") + "; _top:expression(eval(document.documentElement.scrollTop + " + h + "))";
                    g.attr("style", j)
                }
            }
            if (document.body.setCapture) {
                document.body.onmousemove = null;
                document.body.onmouseup = null;
                document.body.releaseCapture()
            } else {
                document.removeEventListener("mousemove", e, false);
                document.removeEventListener("mouseup", arguments.callee, false)
            }
        }
    }
};
window.qibu = window.qibu || {};
qibu.dom = {
    getById: function (a) {
        return document.getElementById(a)
    },
    get: function (a) {
        return (typeof (a) == "string") ? document.getElementById(a) : a
    },
    createElementIn: function (f, c, d, b) {
        var a = (c = qibu.dom.get(c) || document.body).ownerDocument.createElement(f || "div"),
			e;
        if (typeof (b) == "object") {
            for (e in b) {
                if (e == "class") {
                    a.className = b[e]
                } else {
                    if (e == "style") {
                        a.style.cssText = b[e]
                    } else {
                        a[e] = b[e]
                    }
                }
            }
        }
        d ? c.insertBefore(a, c.firstChild) : c.appendChild(a);
        return a
    },
    getStyle: function (c, d) {
        c = qibu.dom.get(c);
        if (!c || c.nodeType == 9) {
            return null
        }
        var h = document.defaultView && document.defaultView.getComputedStyle,
			a = !h ? null : document.defaultView.getComputedStyle(c, ""),
			g = "";
        switch (d) {
            case "float":
                d = h ? "cssFloat" : "styleFloat";
                break;
            case "opacity":
                if (!h) {
                    var f = 100;
                    try {
                        f = c.filters["DXImageTransform.Microsoft.Alpha"].opacity
                    } catch (b) {
                        try {
                            f = c.filters("alpha").opacity
                        } catch (b) { }
                    }
                    return f / 100
                } else {
                    return parseFloat((a || c.style)[d])
                }
                break;
            case "backgroundPositionX":
                if (h) {
                    d = "backgroundPosition";
                    return ((a || c.style)[d]).split(" ")[0]
                }
                break;
            case "backgroundPositionY":
                if (h) {
                    d = "backgroundPosition";
                    return ((a || c.style)[d]).split(" ")[1]
                }
                break
        }
        if (h) {
            return (a || c.style)[d]
        } else {
            return (c.currentStyle[d] || c.style[d])
        }
    },
    setStyle: function (b, d, h) {
        if (!(b = qibu.dom.get(b)) || b.nodeType != 1) {
            return false
        }
        var f, a = true,
			i = (f = document.defaultView) && f.getComputedStyle,
			e = /z-?index|font-?weight|opacity|zoom|line-?height/i;
        if (typeof (d) == "string") {
            f = d;
            d = {};
            d[f] = h
        }
        for (var c in d) {
            h = d[c];
            if (c == "float") {
                c = i ? "cssFloat" : "styleFloat"
            } else {
                if (c == "opacity") {
                    if (!i) {
                        c = "filter";
                        h = h >= 1 ? "" : ("alpha(opacity=" + Math.round(h * 100) + ")")
                    }
                } else {
                    if (c == "backgroundPositionX" || c == "backgroundPositionY") {
                        f = c.slice(-1) == "X" ? "Y" : "X";
                        if (i) {
                            var g = qibu.dom.getStyle(b, "backgroundPosition" + f);
                            c = "backgroundPosition";
                            typeof (h) == "number" && (h = h + "px");
                            h = f == "Y" ? (h + " " + (g || "top")) : ((g || "left") + " " + h)
                        }
                    }
                }
            }
            if (typeof b.style[c] != "undefined") {
                b.style[c] = h + (typeof h === "number" && !e.test(c) ? "px" : "");
                a = a && true
            } else {
                a = a && false
            }
        }
        return a
    },
    getScrollTop: function (b) {
        var a = b || document;
        return Math.max(a.documentElement.scrollTop, a.body.scrollTop)
    },
    getClientHeight: function (b) {
        var a = b || document;
        return a.compatMode == "CSS1Compat" ? a.documentElement.clientHeight : a.body.clientHeight
    }
};
qibu.string = {
    RegExps: {
        trim: /^\s+|\s+$/g,
        ltrim: /^\s+/,
        rtrim: /\s+$/,
        nl2br: /\n/g,
        s2nb: /[\x20]{2}/g,
        URIencode: /[\x09\x0A\x0D\x20\x21-\x29\x2B\x2C\x2F\x3A-\x3F\x5B-\x5E\x60\x7B-\x7E]/g,
        escHTML: {
            re_amp: /&/g,
            re_lt: /</g,
            re_gt: />/g,
            re_apos: /\x27/g,
            re_quot: /\x22/g
        },
        escString: {
            bsls: /\\/g,
            sls: /\//g,
            nl: /\n/g,
            rt: /\r/g,
            tab: /\t/g
        },
        restXHTML: {
            re_amp: /&amp;/g,
            re_lt: /&lt;/g,
            re_gt: /&gt;/g,
            re_apos: /&(?:apos|#0?39);/g,
            re_quot: /&quot;/g
        },
        write: /\{(\d{1,2})(?:\:([xodQqb]))?\}/g,
        isURL: /^(?:ht|f)tp(?:s)?\:\/\/(?:[\w\-\.]+)\.\w+/i,
        cut: /[\x00-\xFF]/,
        getRealLen: {
            r0: /[^\x00-\xFF]/g,
            r1: /[\x00-\xFF]/g
        },
        format: /\{([\d\w\.]+)\}/g
    },
    commonReplace: function (c, a, b) {
        return c.replace(a, b)
    },
    format: function (b) {
        var a = Array.prototype.slice.call(arguments),
			c;
        b = String(a.shift());
        if (a.length == 1 && typeof (a[0]) == "object") {
            a = a[0]
        }
        qibu.string.RegExps.format.lastIndex = 0;
        return b.replace(qibu.string.RegExps.format, function (d, e) {
            c = qibu.object.route(a, e);
            return c === undefined ? d : c
        })
    }
};
qibu.object = {
    routeRE: /([\d\w_]+)/g,
    route: function (b, c) {
        b = b || {};
        c = String(c);
        var d = qibu.object.routeRE,
			a;
        d.lastIndex = 0;
        while ((a = d.exec(c)) !== null) {
            b = b[a[0]];
            if (b === undefined || b === null) {
                break
            }
        }
        return b
    }
};
var ua = qibu.userAgent = {},
	agent = navigator.userAgent;
ua.ie = 9 - ((agent.indexOf("Trident/5.0") > -1) ? 0 : 1) - (window.XDomainRequest ? 0 : 1) - (window.XMLHttpRequest ? 0 : 1);
if (typeof (qibu.msgbox) == "undefined") {
    qibu.msgbox = {}
}
qibu.msgbox._timer = null;
qibu.msgbox.loadingAnimationPath = qibu.msgbox.loadingAnimationPath || ("loading.gif");
qibu.msgbox.show = function (d, i, g, e) {
    if (typeof (e) == "number") {
        e = {
            topPosition: e
        }
    }
    e = e || {};
    var a = qibu.msgbox,
		f = '<span class="qibu_msgbox_layer" style="display:none;z-index:10000;" id="mode_tips_v2"><span class="gtl_ico_{type}"></span>{loadIcon}{msgHtml}<span class="gtl_end"></span></span>',
		b = '<span class="gtl_ico_loading"></span>',
		j = [0, 0, 0, 0, "succ", "fail", "clear"],
		c, h;
    a._loadCss && a._loadCss(e.cssPath);
    c = qibu.dom.get("q_Msgbox") || qibu.dom.createElementIn("div", document.body, false, {
        className: "qibu_msgbox_layer_wrap"
    });
    c.id = "q_Msgbox";
    c.style.display = "";
    c.innerHTML = qibu.string.format(f, {
        type: j[i] || "hits",
        msgHtml: d || "",
        loadIcon: i == 6 ? b : ""
    });
    a._setPosition(c, g, e.topPosition)
};
qibu.msgbox._setPosition = function (f, e, g) {
    e = e || 2000;
    var a = qibu.msgbox,
		b = qibu.dom.getScrollTop(),
		c = qibu.dom.getClientHeight(),
		d = Math.floor(c / 3) - 40;
    qibu.dom.setStyle(f, "top", ((document.compatMode == "BackCompat" || qibu.userAgent.ie < 7) ? b : 0) + ((typeof (g) == "number") ? g : d) + "px");
    clearTimeout(a._timer);
    f.firstChild.style.display = "";
    e && (a._timer = setTimeout(a.hide, e))
};
qibu.msgbox.hide = function (b) {
    if ($("#divMask").size() > 0) {
        $("#divMask").hide()
    }
    var a = qibu.msgbox;
    if (b) {
        clearTimeout(a._timer);
        a._timer = setTimeout(a._hide, b)
    } else {
        a._hide()
    }
};
qibu.msgbox._hide = function () {
    var a = qibu.dom.get("q_Msgbox"),
		b = qibu.msgbox;
    clearTimeout(b._timer);
    if (a) {
        var c = a.firstChild;
        qibu.dom.setStyle(a, "display", "none")
    }
};
qibu.msgbox.success = function (b, a) {
    qibu.msgbox.show(b, 4, a)
};
qibu.msgbox.warning = function (b, a) {
    qibu.msgbox.show(b, 1, a)
};
qibu.msgbox.fail = function (b, a) {
    qibu.msgbox.show(b, 5, a)
};
qibu.msgbox.loading = function (c, b) {
    b = b || 1000000;
    qibu.msgbox.show(c, 6, b);
    if ($("#divMask").size() > 0) {
        $("#divMask").show()
    } else {
        var a = $('<div id="divMask" style="position:absolute;top:0px; left:0px; background:#000; z-index:9999; filter:alpha(opacity=30); opacity:0.2; width:100%;height:100%;"></div>');
        $("body").append(a)
    }
};